import instance from './require'
import type{listTS} from '../store/listTS'
// 获取商品列表
export let getlist=():Promise<Array<listTS>>=>{
    return instance.get('/ps')
}
// 添加商品列表
export let addlist=(obj:listTS):Promise<listTS>=>{
    return instance.post('/ps',obj)
}
// 编辑商品列表
export let editlist=(obj:listTS):Promise<listTS>=>{
    return instance.patch(`/ps/${obj.id}`,obj)
}
// 删除商品列表
export let dellist=(id:number|string)=>{
    return instance.delete(`/ps/${id}`)
}
// export let searchcode=(title:number)=>{
//     return instance.get('/ps',{params:{title:title}})
// }
// export let searchname=(keyname:string)=>{
//     return instance.get('/ps',{params:{keyname_like:keyname}})
// }
// export let searchstate=(state:boolean)=>{
//     return instance.get('/ps',{params:{state:state}})
// }

